pub mod tls_client;

use crate::common::{config::AgentConfig, errors::Result};
use tracing::{info, error};

pub async fn run(server: String, config_path: String) -> Result<()> {
    // 加载配置
    let config = crate::common::config::load_agent_config(&config_path)?;
    
    info!("Agent configuration loaded successfully");
    
    // 启动TLS客户端
    let tls_handle = tokio::spawn(tls_client::start_tls_client(config.clone()));
    
    info!("Agent started, connecting to server: {}", server);
    
    // 等待TLS客户端任务完成
    tls_handle.await?;
    
    Ok(())
} 